5 REM * PUBLIC DOMAIN SOFTWARE *
10 '++++++++ PC MAN BY ED DAVIS +++++++
15 DIM S%(300)
20 GOSUB 65019
25 GOSUB 5000
26  GOSUB 2000:GOSUB 4000
30 GOTO 1000
60 ZX=STICK(0):ZY=STICK(1)
61 IF INT(ZY/40)=0 THEN T=2
62 BT%=STRIG(1):IF BT%<>-1 GOTO 72
63 IF SS<1 GOTO 72
64 SHOT=0:IF DC=4 AND XC=XY AND YC>YY OR DC=3 AND YC=YY AND XC>XY OR DC=2 AND XC=XY AND YC<YY OR DC=1 AND YC=YY AND XC<XY THEN SHOT=1
66 PLAY "MBL64T255O5CDEFGAB"
67 SS=SS-1:LOCATE 23,5:PRINT"PHASOR SHOTS REMAINING >";SS;
68 IF SHOT=0 GOTO 72
69 PUT(XC*12,YC*12),GC%:PUT (XC*12,YC*12),BB%: PLAY"MFL64T200O1CEACEA"
70 FOR I=1 TO 500:NEXT I
71  PUT (XC*12,YC*12),BB%:XC=22-XC:YC=12-YC:PUT(XC*12,YC*12),GC%:DC=DC+2:IF DC>4 THEN DC=DC-4
72  PUT(12*XY,12*YY),G%
76 IF ABS(XY-11)>1 AND ABS (YY-6)>1 THEN 110
78 ON DY GOTO 80,85,90,95
80 IF XY=12 THEN 150
81 ZX=STICK(0)
82 Z=INT(ZX/50)-1:LY=LY+Z:YY=YY+Z:IF LY<1 OR LY>5 THEN LY=LY-Z:YY=YY-Z
84 GOTO 150
85 IF YY=5 THEN 150
86 ZX=STICK(0)
87 Z=INT(ZX/50)-1:LY=LY+Z:XY=XY-Z:IF LY<1 OR LY>5 THEN LY=LY-Z:XY=XY+Z
89 GOTO 150
90 IF XY=10 THEN 150
91 ZX=STICK(0)
92 Z=INT(ZX/50)-1:LY=LY+Z:YY=YY-Z:IF LY<1 OR LY>5 THEN LY=LY-Z:YY=YY+Z
94 GOTO 150
95 IF YY=7 THEN 150
96 ZX=STICK(0)
97 Z=INT(ZX/50)-1:LY=LY+Z:XY=XY+Z:IF LY<1 OR LY>5 THEN LY=LY-Z:XY=XY-Z
99 GOTO 150
110 IF ABS(XY-11)<LY+6 OR ABS(YY-6)<LY+1 THEN 150
120 DY=DY-1:IF DY=0 THEN DY=4
150 ON DY GOTO 160,170,180,190
160 XY=XY+1:GOTO 200
170 YY=YY+1:GOTO 200
180 XY=XY-1:GOTO 200
190 YY=YY-1
200 IF XY=XC AND YY=YC THEN 3000
205 IF RK>2 THEN IF XY=XD AND YY=YD THEN CCC=1:GOTO 3000
210 Z%=XY*13+YY:SZ%=S%(Z%):IF SZ%<1 THEN 240
220 SC=SC+(S%(Z%)-1)*4+1:C=C-1:LOCATE 12,16:PRINT SC
222 IF SZ%=1 THEN PLAY "MBL32T255O1D":PUT(XY*12,YY*12),M1%
223 IF SZ%=2 THEN PLAY "MBL32T255O2ACA":PUT(XY*12+1,YY*12+1),M%
224 S%(Z%)=0
230 IF C=0 THEN 1015
240 IF T=2 THEN T=1:GOTO 110
250 PUT (XY*12,YY*12),G%
260 IF RK>2 THEN T=2:SW=1-SW:ON SW +1 GOTO 300,500
300 PUT(XC*12,YC*12),GC%
305 SZ%=S%(XC*13+YC)
307 IF SZ%=2 THEN PUT(XC*12+1,YC*12+1),M%,PSET
310 IF XC<>11 AND YC<>6 THEN 360
315 R=0:IF RND(1)<.2 THEN R=1
320 Z=SGN(LY-LC):LC=LC+Z
330 ON DC GOTO 335,340,345,350
335 YC=YC-Z:GOTO 400
340 XC=XC+Z:GOTO 400
345 YC=YC+Z:GOTO 400
350 XC=XC-Z:GOTO 400
360 IF ABS(XC-11)<LC+6 OR ABS(YC-6)<LC+1 THEN 400
370 DC=DC+1:IF DC=5 THEN DC=1
400 ON DC GOTO 410,420,430,440
410 XC=XC+1:GOTO 450
420 YC=YC+1:GOTO 450
430 XC=XC-1:GOTO 450
440 YC=YC-1
450 IF XC=XY AND YC=YY THEN GOTO 3000
455 IF R=0 THEN 470
457 Z%=XC*13+YC:IF S%(Z%)=0 THEN C=C+1
460 S%(Z%)=2
470 IF TT=2 THEN TT=1:GOTO 300
480 PUT (XC*12,YC*12),GC%
490 GOTO 60
500 PUT (XD*12,YD*12),GC%
510 IF XD<>11 AND YD<>6 THEN 560
520 Z=SGN(LY-LD):LD=LD+Z
530 ON DD GOTO 535,540,545,550
535 YD=YD-Z:GOTO 600
540 XD=XD+Z:GOTO 600
545 YD=YD+Z:GOTO 600
550 XD=XD-Z:GOTO 600
560 IF ABS(XD-11)<LD+6 OR ABS(YD-6)<LD+1 THEN 600
570 DD=DD+1:IF DD=5 THEN D=1
600 ON DD GOTO 610,620,630,640
610 XD=XD+1:GOTO 650
620 YD=YD+1:GOTO 650
630 XD=XD-1:GOTO 650
640 YD=YD-1
650 IF XD=XY AND YD=YY THEN CCC=1: GOTO 3000
655 IF TT=2 THEN TT=1:GOTO 500
660 PUT (XD*12,YD*12),GC%
670 GOTO 60
999 END
1000 REM INITIALIZATION
1008 COLOR 0
1010 SCREEN 1,0
1011 HS=0:SC=0:SW=0
1013  IF SC>HS THEN HS=SC
1014 SC=0:RK=0:IF PK$="2" THEN RK=2
1015 C=200:RK=RK+1:SS=3:CCC=0
1020 CLS
1030 FOR Y=0 TO 60 STEP 12
1040 LINE (Y,Y)-(276-Y,Y):LINE -(276-Y,156-Y):LINE -(Y,156-Y):LINE -(Y,Y)
1050 NEXT
1070 FOR Y=12 TO 48 STEP 12
1080 LINE (Y,65)-(Y,91),0
1090 LINE (276-Y ,65)-(276-Y,91),0
1100 LINE (125,Y)-(151,Y),0
1110 LINE (125,156-Y)-(151,156-Y),0
1120 NEXT
1122 FOR I=1 TO 299:S%(I)=0:NEXT I
1125 :
1130 FOR Y=0 TO 4
1140 FOR X=0 TO 9
1150 PUT(12*X,12*Y),M1%:S%(13*X+Y)=1
1160 PUT(264-12*X,12*Y),M1%:S%(13*(22-X)+Y)=1
1170 PUT(12*X,144-12*Y),M1%:S%(13*X+(12-Y))=1
1180 PUT(264-12*X,144-12*Y),M1%:S%(13*(22-X)+(12-Y))=1
1190 NEXT X:NEXT Y
1220 XC=10:YC=12:DC=3:LC=5:XY=12:YY=12:DY=1:LY=5
1240 PUT(XY*12,YY*12),G%
1250 PUT(XC*12,YC*12),GC%
1255 IF RK>2 THEN XD=10:YD=0:DD=1:LD=5:PUT(XD*12,YD*12),GC%
1260 LOCATE 10,15:PRINT"SCORE"
1265 LOCATE 11,15:PRINT"~~~~~"
1280 LOCATE 25,1:PRINT "    HIGHEST SCORE TODAY } ";HS;
1290 FOR I=1 TO 1000:NEXT I:GOTO 60
2000 REM CREATE CARACTERS
2010 DIM G%(18):DIM GC%(18):DIM M%(18):DIM M1%(18):DIM BB%(80)
2020 CLS
2030 SCREEN 1,0:COLOR 0,1:OUT 980,2:OUT 981,43
2040 LINE (103,103)-(107,107),2,BF
2050 GET(100,100)-(109,109),M%
2060 CLS
2070 CIRCLE (105,105),5,3
2080 PAINT (105,105),2,3
2090 GET(100,100)-(110,110),GC%
2100 REM PAINT MAN +++++++++++++++++
2102 CLS
2105 ' LINE (100,100)-(110,110),3,B
2110 PRESET (100,100):DRAW"C3S4"
2112 DRAW"BR3R4D2L1D1R4D2L4D1R1D2R2D2L3U2L2D2L3U2R2U4L3U2R4U1L1U2"
2116 PAINT (105,103),3,3
2120 GET (100,100)-(110,110),G%
2125 CLS
2130 LINE(105,103)-(105,107),3
2140 LINE(103,105)-(107,105),3
2150 GET(100,100)-(110,110),M1%
2160 CLS
2170 CIRCLE (110,110),10,3
2180 PAINT (110,110),2,3
2190 GET (100,100)-(120,120),BB%
2800 CLS
2900 RETURN
3000 REM BLOW UP SEQUENCE ON COLLISION
3010 PLAY"MB L32T64O1EAEAEAEA"
3018 IF RK>2  AND CCC=1 THEN PUT (XD*12,YD*12),BB%,PRESET:GOTO 3030
3020 PUT(XC*12,YC*12),BB%,PRESET
3030 PLAY"L64O1AP10BP30CP20FEA"
3040 FOR I=1 TO 400:NEXT I
3100 GOTO 1013
4000 ' INFO AND QUESTIONS
4100 CLS
4110 LOCATE 1,3:PRINT "WELCOME TO THE GAME OF  *PC*  MAN"
4120 LOCATE 4,2:PRINT " Using the control stick you will be":PRINT " moving a man thru a maze filled with
4125 PRINT""
4130 PRINT "   GOOD THINGS, AND BAD PEOPLE."
4135 PRINT""
4140 PRINT"  Push the stick forward to go FASTER"
4150 PRINT"  Push button to FIRE phasor, but you"
4155 PRINT"  only have 3 shots !"
4160 PRINT"  The more you eat the higher your score"
4170 PRINT"  The bad guys only want to eat YOU!"
4175 PRINT"  Every once in a while a bad guy may "
4180 PRINT"  drop some special food... "
4184 PRINT" ":PRINT"   Hope you enjoy yourself."
4185 PRINT"           Ed Davis"
4190 LOCATE 25,4:PRINT "press space bar to continue";:I$=INKEY$
4192 IF I$<>" "GOTO 4190
4200 CLS
4210 PRINT" ":PRINT"~~~~~THE CAST OF CHARACTERS~~~~~"
4220  LOCATE 5,2:PRINT "                  YOU>"
4230  LOCATE 7,2:PRINT "         THE BAD GUYS>"
4240  LOCATE 9,2:PRINT "FOOD  (WORTH 1 POINT)>"
4250  LOCATE 11,2:PRINT"FOOD (WORTH 5 POINTS)>"
4300 PUT (200,30),G%
4310 PUT (200,46),GC%
4320 PUT (200,62),M1%
4330 PUT (200,78),M%
4360 LOCATE 19,3:PRINT "YOU MAY START IN THE CAGE WITH EITHER"
4370 LOCATE 20,3:PRINT "ONE OR TWO OF THE 'BAD GUYS'.
4380 LOCATE 22,3:PRINT"HOW MANY DO YOU WISH (1 OR 2) ?";:PK$=INKEY$
4390 RK=0
4400 IF PK$="1" THEN RK=1 :RETURN
4410 IF PK$="2" THEN RK=2: RETURN
4420 GOTO 4380
4999 END
5000 CLS:KEY OFF:STRIG ON
5005 LOCATE 25,5:PRINT " PRESS ANY KEY TO END THIS TEST"
5010 LOCATE 3,5:PRINT"THIS GAME REQUIRES A JOYSTICK":PRINT
5020 PRINT "HOLD JOYSTICK  SUCH THAT AS YOU MOVE IT
5030 PRINT "LEFT AND RIGHT, UP AND DOWN, AND WHEN "
5035 PRINT"YOU PRESS THE BUTTON YOU GET"
5040 PRINT "THE CORRECT RESPONSES BELOW........
5050 K$=INKEY$: IF K$<>""THEN RETURN
5060 SX=STICK(0):SY=STICK(1)
5070 LOCATE 10,10: PRINT"X VAL.     Y VAL. "
5075 REM ~~~~~~~~~~~~NOTE DECISION VALUE SET AT 50~~~~~~~~~~~~~~
5080 LOCATE 11,10:PRINT SX;"       ";SY;"   "
5090  ZX=INT(SX/50)  :ZY=INT(SY/50)
5100  IF ZX=0 THEN M$="  <<<< LEFT HAND TURN         "
5110  IF ZX=1 THEN M$="    ^  STAIGHT AHEAD  ^       "
5120 IF ZX=2 THEN M$="       RIGHT HAND TURN >>>>   "
5130 IF ZY=0 THEN MM$=" FASTER      "
5140 IF ZY<>0 THEN MM$="NORMAL SPEED"
5150 LOCATE 15,4:PRINT M$
5160 LOCATE 17,11:PRINT MM$
5170 BT%=STRIG(1)
5180 LOCATE 20,8:PRINT "                   "
5190 IF BT%=-1 THEN LOCATE 20,8:PRINT"BUTTON IS PRESSED!"
5300 GOTO 5050
6000 '@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
6005 '
6010 '          REMARKS
6015 '
6020 '@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
6030 '
6040 ' WRITTED BY ED DAVIS ,BURLINGTON
6045 '    EXTENSION (8-446)-2091
6050 '   FROM IDEAS BY M. PELCZARSKI
6060 '           1-1-81
6070 '
6080 ' NOTE LINE 2030 USES "OUT" COMMANDS
6090 ' TO SHIFT THE SCREEN LEFT, IF YOU
6100 ' ARE USING A MONITOR YOU MAY WISH
6110 ' TO REMOVE THESE.  ALSO THE SENSI-
6120 ' TIVITY OF THE PADDLES MAY BE
6130 ' CHANGED ON LINES 61 AND 87.
6140 '
6150 '
50000 END
65000 ' COLOR MONITOR-MONOCHROME MONITOR SWITCH    EMD 11-81
65001 CLS
65002 PRINT:PRINT"IF YOU WANT TO TOGGLE MONOCHROME/COLOR  THEN;"
65003 PRINT"   FOR COLOR PRESS - C"
65004 PRINT"   FOR MONO  PRESS - M"
65005 PRINT"   FOR NO CHANGE PRESS ANY OTHER KEY."
65006 K$=INKEY$:IF K$="" GOTO 65006
65007 IF K$="C" OR K$="c" THEN GOSUB 65019:END
65008 IF K$="M" OR K$="m" THEN GOSUB 65011:END
65009 CLS
65010 PRINT"@@@@@@@@@@@@    NO CHANGE   @@@@@@@@@@@@@@":END
65011 REM switch to monochrome adapter
65012 DEF SEG=0
65013 POKE &H410,(PEEK(&H410) OR &H30)
65014 DEF SEG
65015 LOCATE ,,1,12,13
65016 SCREEN 0
65017 WIDTH 80
65018 RETURN
65019 REM switch to color/graphics adapter
65020 DEF SEG=0
65021 POKE &H410,(PEEK(&H410) AND &HCF) OR &H20
65022 DEF SEG
65023 LOCATE ,,1,6,7
65024 SCREEN 0
65025 WIDTH 40
65026 RETURN
